package com.contant;

public class Status {

	public static final String ONE = "1";
	public static final String ZERO = "0";
	
	public static boolean isOne(String s){
		if(s != null && s.equals(ONE))
			return true;
		else
			return false;
	}
	
	public static boolean isZero(String s){
		if(s != null && s.equals(ZERO))
			return true;
		else
			return false;
	}
	
	public static boolean isOneOrZero(String s){
		if(s != null && (s.equals(ONE) || s.equals(ZERO)))
			return true;
		else
			return false;
	}
	
	public static String convertToZeroOrOne(String s){
		if(s == null || s.trim().length() == 0)
			return ZERO;
		else if(s.trim().equals(ONE))
			return ONE;
		else if(s.trim().equals(ZERO))
			return ZERO;
		else
			return ZERO;
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
